package com.baijia.dao.po;

import java.util.Arrays;
import java.util.List;

import lombok.Data;

/**
 * @title AuthorizeService
 * @desc passport.properties读来
 * @author caoliang
 * @date 2015年12月5日
 * @version 1.0
 */
@Data
public class AuthorizeService {

    private int id;
    private int appId;
    private String serviceId;
    private String name;
    private String allowDomains;
    private String loginAddr;
    private String loginSuccessAddr;
    private Integer loginMaxTimes;
    private Integer loginNoticeTimes;
    private Integer banSeconds;

    public AuthorizeService() {

    }

    public AuthorizeService(int id, String serviceId, String name, String allowDomains, String loginAddr,
        String loginSuccessAddr, Integer loginMaxTimes, Integer loginNoticeTimes) {
        this.id = id;
        this.serviceId = serviceId;
        this.name = name;
        this.allowDomains = allowDomains;
        this.loginAddr = loginAddr;
        this.loginSuccessAddr = loginSuccessAddr;
        this.loginMaxTimes = loginMaxTimes;
        this.loginNoticeTimes = loginNoticeTimes;
    }

    public List<String> getAllowDomainsList() {
        return Arrays.asList(allowDomains.split(","));
    }
}
